<!DOCTYPE html>
<html lang="zh-CN">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>图片懒加载</title>
    <style>
      * {
        padding: 0;
        margin: 0;
      }
      ul {
        list-style: none;
        width: 400px;
        margin: 10px auto;
        padding: 10px;
        display: flex;
        flex-flow: row wrap;
        justify-content: space-between;
        max-height: 300px;
        overflow: auto;
      }

      img {
        height: 200px;
      }
    </style>
  </head>
  <body>
    <ul>
      <li><img src="./assets/images/default_image.jpg" data-url="./assets/images/waterfall-3.jpg" /></li>
      <li><img src="./assets/images/default_image.jpg" data-url="./assets/images/waterfall-4.jpg" /></li>
      <li><img src="./assets/images/default_image.jpg" data-url="./assets/images/waterfall-5.jpg" /></li>
      <li><img src="./assets/images/default_image.jpg" data-url="./assets/images/waterfall-6.jpg" /></li>
      <li><img src="./assets/images/default_image.jpg" data-url="./assets/images/waterfall-7.jpg" /></li>
      <li><img src="./assets/images/default_image.jpg" data-url="./assets/images/waterfall-8.jpg" /></li>
      <li><img src="./assets/images/default_image.jpg" data-url="./assets/images/waterfall-9.jpg" /></li>
    </ul>

    <script src="./intersectionObserver.js"></script>
  </body>
</html>
